<?php //echo Yii::app()->assetManager->baseUrl; exit; ?>
<?php
/* @var $this DirectoriesController */
/* @var $model Directories */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
    var img={
        <?php if(isset($files) && $files): ?>
        <?php foreach($files as $num=>$file): ?>
        <?php echo $num.':'.'"'.$file->name.'", '; ?>
        <?php endforeach; ?>
        <?php endif; ?>
    };
</script>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'directories-form',
	'enableAjaxValidation'=>false,
)); ?>
	<?php echo $form->errorSummary($model); ?>

	<div class="row">
            <?php echo $form->labelEx($model,'name'); ?>
            <?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>128)); ?>
            <?php echo $form->error($model,'name'); ?>
	</div>

	<div class="row buttons">
        <?php echo CHtml::submitButton('Изменить', array(
            'name'=>'update',
            'onclick'=>'return rename(img);',
        )); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php Yii::app()->getClientScript()->registerScriptFile(Yii::app()->assetManager->baseUrl.'/directories/validate_names.js'); ?>
